﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Common;
using DataAccess;

/// <summary>
/// Summary description for UpdateCandidate
/// </summary>
public class UpdateCandidate
{
	public UpdateCandidate()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public bool Update(Candidate candidate)
    {
        bool result = false;
        DbCommand cmd = GenericData.CreateCommand();
        cmd.CommandText = "Update Candidate SET Fullname = '" + candidate.Fullname + "', Email = '" + candidate.Email + "', Mobile = '" + candidate.Mobile + "', Address = '" + candidate.Address + "', Certificate = '" + candidate.Certificate + "', Experience = '" + candidate.Experience + "' WHERE ID = " + candidate.ID;
        if (GenericData.ExecuteNoneQuery(cmd) > 0)
            result = true;
        return result;
    }
}